#pragma once
#include "cocos2d.h"
#include "EventHelper.h"
#include "UICommon.h"

USING_NS_CC;

class UIFallingModePanel :public LayerColor
{
	public:
	UIFallingModePanel() {};
	static UIFallingModePanel* create(Size size, int keycount);

	void setTrackWidth(float trackwidth, float trackwidths = 0);
	void createKeys();

	private:
	Size size;
	int keycount;
	int type;
	float trackWidth = 0;
	float trackWidthS = 0;

};

class UIFallingModeHitJudgment :public LayerColor
{
	public:
	UIFallingModeHitJudgment() {};
	static UIFallingModeHitJudgment* create(Size size);

	enum JUDGMENT
	{
		DREAM,
		GREAT,
		GOOD,
		POOR,
		BREAK,
		LOADING
	};

	Color3B judgcolors[8] =
	{
		Color3B(255,255,255),
		Color3B(255,128,255),
		Color3B(255,128,128),
		Color3B(128,128,255),
		Color3B(255,190,128),
		Color3B(255,255,128),
		Color3B(128,128,128),
		Color3B(255,0,0)
	};

	void setInfo(JUDGMENT judgment, string comboval);
	void setLightEffect(JUDGMENT judgment);
	void playChangeEffect();

	private:
	Size size;
	Label* judgtext;
	Label* combotext;
	LayerColor* underline;
};